#ifndef TRUE
#define TRUE 1
#endif

#ifndef FALSE
#define FALSE 0
#endif

/*
* Convert string XX:XX:XX:XX:XX:XX format to unsigned char[6]
*/
int convert_mac_to_bytes(const char *str, unsigned char *mac){
	int tmp[6];
	int i;
	if( sscanf(str, "%x:%x:%x:%x:%x:%x", &tmp[0], &tmp[1], &tmp[2], &tmp[3], &tmp[4], &tmp[5] ) == 6){
		for(i=0;i<6;i++){
			mac[i] = (unsigned char) tmp[i];
		}
		return TRUE;
	}
	else{
		return FALSE;
	}
}